package TeamManager;

import Behaviours.ComportamientoAtacante;
import Behaviours.ComportamientoAtacante2;
import Behaviours.ComportamientoBlocker;
import Behaviours.ComportamientoDefensa;
import Behaviours.ComportamientoDefensa2;
import Behaviours.ComportamientoFSM;
import Behaviours.ComportamientoGoToBall;
import Behaviours.ComportamientoGoToPosition;
import Behaviours.ComportamientoPortero;
import Messages.MensajePosicion;
import teams.ucmTeam.Behaviour;
import teams.ucmTeam.Message.Type;
import teams.ucmTeam.RobotAPI;
import teams.ucmTeam.TeamManager;

public class Entrenador extends TeamManager {


	@Override
	public int onConfigure() {
		return RobotAPI.ROBOT_OK;
	}
	
	@Override
	public void onTakeStep() {
//		RobotAPI robot0 = _players[0].getRobotAPI();
//		MensajePosicion message = new MensajePosicion();
//		message.setReceiver(0);
//		message.setType(Type.unicast);
//		message.setPosicion(robot0.toFieldCoordinates(robot0.getOpponentsGoal()));
//		sendMessage(message);
//		_players[0].setBehaviour(_behaviours[2]);
		
	}
	
	@Override
	public Behaviour getDefaultBehaviour(int id) {
//		if (id == 0 || id ==2)
//			return _behaviours[1];
		if (id == 0)
			return _behaviours[1];
		if (id == 1)
			return _behaviours[2];
		if (id == 2)
			return _behaviours[3];
		if (id == 3)
			return _behaviours[4];
		if (id == 4)
			return _behaviours[5];
		else
			return _behaviours[0];
	}
	
	@Override
	public Behaviour[] createBehaviours() {
//		Behaviour[] behav =new Behaviour[3];
//		behav[0]=new GoToBall();
//		behav[1] = new Blocker();
//		behav[2] = new GoToPosition();
		return new Behaviour[] {new ComportamientoFSM(), 
								new ComportamientoPortero(),
								new ComportamientoAtacante(), 
								new ComportamientoAtacante2(),
								new ComportamientoDefensa(),
								new ComportamientoDefensa2()};
//		return behav;

	}

}
